// import SvgIcon from '@/components/SvgIcon/index.vue'
// import Pagination from '@/components/Pagination/index.vue'
// const globalComponent:{[key:string]:Object} = { SvgIcon, Pagination }

// export default {
//   install(app: any) {
//     Object.keys(globalComponent).forEach((key) => {
//       app.component(key, globalComponent[key])
//     })
//   },
// }
import SvgIcon from '@/components/SvgIcon/index.vue'
import Category from '@/components/Category/index.vue'
import type { App, Component } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// [name],name名字随意起
const globalComponent: { [name: string]: Component } = {
  SvgIcon,
  Category,
}

export default {
  install(app: App) {
    Object.keys(globalComponent).forEach((key) => {
      app.component(key, globalComponent[key])
    })
    Object.keys(ElementPlusIconsVue).forEach((key) => {
      app.component(
        key,
        ElementPlusIconsVue[key as keyof typeof ElementPlusIconsVue],
      )
    })
    // console.log('',Object.entries(ElementPlusIconsVue));
    // for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    //   app.component(key, component)
    // }
  },
}
